This invention relates to an image data decoding method and apparatus for decoding encoded image data obtained by dividing image data into a predetermined number of blocks and then encoding the data block by block.
Conventionally, image data representing a single image is divided into a plurality of tiles each consisting of Nxc3x97M pixels, an encoding scheme is decided for each tile and the image data is stored as a hierarchy of multiple resolutions. The FlashPix file is a known example of such an image data format. In the case of a FlashPix file, the images of the respective hierarchical layers of resolution are all divided into tiles of 64xc3x9764 pixels. In a case where image data having a certain resolution (here the number of pixels) is encoded in accordance with the JPEG standard, image data having this resolution, i.e., all tiles constructing the image data having this resolution, is encoded usually using the same quantization table and the same Huffman table. In such case the JPEG code of each tile does not possess information concerning the quantization and Huffman tables that were used in the encoding; this information is preserved in table form in an area separate from the tile data. Accordingly, the code of each tile is composed of information for identifying which table was used and additional JPEG code.
When a JPEG code that has been preserved in this format is decoded, table data for identifying the table and the code of each tile are merged tile by tile to create a single item of encoded data and either JPEG decoding processing is executed tile by tile or JPEG decoding processing specific to the format of each tile is executed.
In the example of the prior art described above, decoding processing is executed after the merging of the table data and encoded data of each tile to create one JPEG code for each tile. As a consequence, the processing for merging the encoded data takes time and processing such as initialization of the quantization and Huffman tables in JPEG decoding processing must be executed for all tiles. Thus, processing takes a long period of time. Furthermore, it is not easy to execute JPEG decoding processing exclusively for the data format of FlashPix files.
Accordingly, an object of the present invention is to provide an image data decoding method and apparatus for the high-speed decoding of image data that has been encoded and stored in a file format such as the FlashPix file format.
Another object of the present invention is to provide an image data decoding method and apparatus in which encoded data, which has been obtained by dividing an image into a plurality of blocks and encoding the image on a per-block basis, is arranged taking into consideration the consistency of encoding tables that were used in the encoding, and the encoded data so arranged is decoded, whereby it is possible to eliminate needless initiation of decoding processing afresh for each and every block.
According to the present invention, the foregoing object is attained by providing a decoding apparatus for decoding encoded image data that has been obtained by dividing image data into a plurality of blocks and encoding the image data on a block-by-block basis, comprising: determination means for determining encoding tables that were used in the encoding of each of the plurality of blocks; arranging means for arranging the encoded data of each of the plurality of blocks based upon sameness of the encoding tables determined by the determination means; and decoding means for successively decoding the encoded data arranged by the arranging means.
Further, according to the present invention, the foregoing object is attained by providing a decoding method for decoding encoded image data that has been obtained by dividing image data into a plurality of blocks and encoding the image data on a block-by-block basis, comprising: a determination step of determining encoding tables that were used in the encoding of each of the plurality of blocks; an arranging step of arranging encoded data of each of the plurality of blocks based upon sameness of the encoding tables determined at the determination step; and a decoding step of successively decoding the encoded data arranged at the arranging step.
It is preferred that the encoded data of each block be data encoded in accordance with the JPEG standard.
Furthermore, it is preferred that control codes be inserted at boundaries of the arranged encoded data of each of the plurality of blocks and that the control codes be restart (RST) marker codes, by way of example.
Further, when the codes are arranged, codes of blocks that have not been encoded in accordance with the JPEG standard are excluded.
Further, it is preferred that the image data be stored as a file in the FlashPix format.
Furthermore, the encoding tables include at least a quantization table and a Huffman table.
Further, when there is a code for which a new encoding table has been used, the code is arranged to follow information specifying this encoding table.